"""
带参数的get请求
1）直接对含有参数的url发起请求
   url='https://www.baidu.com/s?wd=python'
2）通过params携带参数字典


"""
import requests

#1)
url='https://www.baidu.com/s?wd=python'

h={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36'}

response=requests.get(url,headers=h)

print(response.content.decode())

#2)
url='https://www.baidu.com/s?'
#将参数保存在字典中
dict_wd={'wd':'python'}
response=requests.get(url,headers=h,params=dict_wd)
print(response.content.decode())